import request from '@/utils/request'

export default {
  getList(page, limit, obj) {
    //列表的方法 

    return request({
      url: `/eduservice/teacher/pageList/${page}/${limit}`,
      method: 'post',
      data: obj
    })
  },
  getListAll(){
    return request({
      url: `/eduservice/teacher/list`,
      method: 'get'
    })
  },
  //根据id删除的方法 
  deleteTeacherId(id) {
    return request({
      url: `/eduservice/teacher/${id}`,
      method: 'delete'
    })

  },
  //添加的方法
  addTeacher(teacher) {
    return request({
      url: `/eduservice/teacher`,
      method: 'put',
      data: teacher
    })
  },
  //根据ID获取讲师
  getTeacherById(id){
    return request({
      url: `/eduservice/teacher/${id}`,
      method: 'get'
    }) 
  },
  //5.修改的方法
  updateTeacherById(teacher){
    return request({
      url: `/eduservice/teacher/updateTeacher/${teacher.id}`,
      method: 'post',
      data:teacher
    }) 
  }
}
